import os
import datetime
import pytest
from loguru import logger
from tools.handle_path import log_file_path, allure_file_path

now_time = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
log_file_name = f"log_{now_time}.log"
log_outputs_file = os.path.join(log_file_path, log_file_name)
# print(log_outputs_file)

logger.add(log_outputs_file, rotation='100 MB', retention=2, compression='zip', backtrace=True, diagnose=True,
           encoding='utf-8')

pytest.main(["-s", "-v",
             f"--alluredir={allure_file_path}",
             "--clean-alluredir",
             "--reruns", "2", "--reruns-delay","5",
             r"--junitxml=outputs\result.xml"])

